﻿using System;

namespace ExtensibleEventViewer.Console.DomainModel
{
	public class TrackedEventLog
	{
		public string EventLogName
		{
			get; 
			set;
		}

		public string ComputerName
		{
			get; 
			set;
		}

		public string ProviderID
		{
			get; 
			set;
		}

		public override bool Equals(object obj)
		{
			if (!(obj is TrackedEventLog))
			{
				return false;
			}

			TrackedEventLog log = (TrackedEventLog) obj;

			if (string.Equals(EventLogName, log.EventLogName, StringComparison.InvariantCultureIgnoreCase) && 
				string.Equals(ComputerName, log.ComputerName, StringComparison.InvariantCultureIgnoreCase) && 
				string.Equals(ProviderID, log.ProviderID, StringComparison.InvariantCultureIgnoreCase))
			{
				return true;
			}

			return false;
		}

		public override int GetHashCode()
		{
			return string.Concat(EventLogName, ComputerName, ProviderID).GetHashCode();
		}
	}
}
